﻿using ConfExpert.Forms.Base;
using DevExpress.XtraEditors.Repository;
using DevTeam;
using System;
using System.Data;

namespace ConfExpert.Forms.Depo
{
    public partial class TasinmadanSonra : XForm
    {
        public TasinmadanSonra()
        {
            InitializeComponent();
        }

        private void TasinmadanSonra_Load(object sender, EventArgs e)
        {
            //((RepositoryItemTextEdit)txtEskiRaf.Edit).Enter += TasinmadanSonra_Enter;
            btnAra.ItemClick += btnAra_ItemClick;
        }

        void btnAra_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string Shelf = txtEskiRaf.EditValue.ToStr().Trim();
            if (Shelf != string.Empty)
            {

                DataSet d = ExecuteDataSet("FindNearestShelf", Shelf);
                gridView1.Init(d.Tables[0]);
                gridView2.Init(d.Tables[1]);
                gridView1.SetViewCaption(Shelf);
                gridView2.SetViewCaption("Toplar");
                gridView1.AddSummary("Qty");
                gridView1.AddSummary("Qty");
                gridView1.BestFitColumns();
                gridView2.BestFitColumns();
            }
        }
    }
}
